using System;
using SharpObjects.Interfaces;
using SharpObjects.PathMapping;

namespace SharpObjects.Instantiation
{
    public interface IInstanceFactory
    {
        /// <summary>
        /// by default is initialized with an instance of DefaultPathMapper
        /// </summary>
        IPathMapper PathMapper { get; set; }

        /// <summary>
        /// Creates an object of the specified type. 
        /// </summary>
        /// <typeparam name="T">The type, created object will be cast to</typeparam>
        /// <param name="internalTypeDescriptor">Specifies the type and arguments</param>
        /// <param name="arguments">Overrides arguments, specified in TypeDescriptor</param>
        /// <returns></returns>
        T CreateObject<T>(ITypeDescriptor internalTypeDescriptor, params object[] arguments);

        Type GetTypeFromTypeDescriptor(ITypeDescriptor typeDescriptor);
    }
}